<?php
$this->setLayout('template'.DS.'default.phtml');
$this->startBlock();
?>
<!-- 会员注册 -->

<script>
    $(function(){
        $('#sort_condition').change(function(){
            if($(this).val()!=' '){
            <?php $url = $this->getUrl(null,'showSubject')?>
            self.location="<?php echo $url?>/sort/"+$(this).val();
            }
        })
//        $('#sort_condition')
    })
</script>
<div class="subject_list">
    <h4>
        <label>排序条件:</label>
        <select id="sort_condition">
            <option value=" " selected="selected">--</option>
            <option value="default">时间</option>
            <option value="clickcount">点击率</option>
        </select>
    </h4>
    <dl>
    <?php foreach($this->subjects as $subject):?>
        <dt><?php echo $subject->getName()?></dt>
        <dd>
        <ol>
            <?php if(Kd_Web::getIdentity()->isAllowAction('subject_edit')):?>
            <a href="<?php echo $this->getUrl(array('id'=>$subject->getId()),'edit','subject','subject')?>">管理主题</a>
            <?php endif;?>
            <?php if(Kd_Web::getIdentity()->isAllowAction('article_edit')):?>
            <a href="<?php echo $this->getUrl(array('subject_id'=>$subject->getId()),'index','article','subject')?>">管理文章</a>
            <?php endif;?>
            <?php if(Kd_Web::getIdentity()->isAllowAction('concessions_edit')):?>
            <a href="<?php echo $this->getUrl(array('subject_id'=>$subject->getId()),'index','concessions','subject')?>">管理优惠</a>
            <?php endif;?>
            <a href="<?php echo $this->getUrl(array('id'=>$subject->getId()),'preview','subject','subject')?>">预览</a>
        </ol>
            <ul>分类：<?php echo $subject->getCategoryName()?></ul>
            <ul><li style="">点击量：<?php echo $subject->getClickCount()?></ul>
        </dd>
        <?php endforeach;?>
    </dl>

</div>
<?php $this->endBlock();


